package com.xyhy.core.web.model.page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel("分页结果")
public class PageResult<T> {
  @ApiModelProperty("当前页码")
  private int page = 1;

  @ApiModelProperty("每页显示条数")
  private int size = 10;

  @ApiModelProperty("总条数")
  private long total = 0;

  @ApiModelProperty("总页数")
  private int totalPage = 0;

  @ApiModelProperty("数据列表")
  private List<T> records = Collections.emptyList();

}
